package com.self.member.feign;

import com.self.api.feign.OAuth2FeignConfig;
import com.self.member.dto.UserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @version v1.0
 * @ClassName: MemberFeignClient
 * @Description:
 * @Author: Mac
 * @Date: 2022/6/19 13:40
 */
@FeignClient(value = "member-service",configuration = OAuth2FeignConfig.class,path = "/users")
public interface UserFeignClient {

    @GetMapping("/basic/users")
    List<UserDto>  getBasicUsers(@RequestParam("ids") List<Long> ids);


    @PostMapping("/basic/users/username")
    Map<Long,UserDto>  getBasicUsersByUsername(@RequestParam(value = "ids",required = false) List<Long> ids,
                                               @RequestParam(value = "username",required = false) String username,
                                               @RequestParam(value = "mobile",required = false) String mobile);

}
